package xio.ccf_201409;

import java.util.Scanner;

/**
 * 201409-2 画图 100分
 * Created by Xio on 2017/11/6 0006.
 */
public class Paint {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = 0;
        int x1,x2,y1,y2;
        int n = sc.nextInt();
        int[][] coordinate = new int[101][101];
        for (int i = 0; i < n; i++) {
            x1 = sc.nextInt();
            y1 = sc.nextInt();
            x2 = sc.nextInt();
            y2 = sc.nextInt();
            for (int j = x1; j < x2; j++) {
                for (int k = y1; k < y2; k++) {
                    if (coordinate[j][k] == 0) {
                        coordinate[j][k] = 1;
                        size++;
                    }
                }
            }
        }

        System.out.println(size);
    }
}
